package com.acme.bankapp.service.listener;

import com.acme.bankapp.domain.bank.*;
import com.acme.bankapp.service.email.*;

/**
 * Class provides email client listener functionality
 * @author alex
 */
@SuppressWarnings("serial")
public class EmailNotificationListener implements ClientRegistrationListener {
	private EmailService emailService;
	
	/**
	 * The default constructor
	 */
	public EmailNotificationListener() {
		this.emailService = new EmailService();
	}
	
	/**
	 * @return the email service
	 */
	public EmailService getEmailService() {
		return this.emailService;
	}
	
	/**
	 * @param client the client
	 */
	public void onClientAdded(Client client) {
		this.emailService.sendNotificationEmail(client);
	}
}
